cmake_minimum_required(VERSION 2.8)

set(XSDK_ALL_INCLUDE 
      ${CMAKE_CURRENT_LIST_DIR}
      ${CMAKE_CURRENT_LIST_DIR}/include)

set(XSDK_ALL_SOURCE 
      ${CMAKE_CURRENT_LIST_DIR}/source/XMD5.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/LargeFiles.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/OS.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/Rand.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/StackTrace.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/TimeUtils.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/UuidUtils.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XBaseObject.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XBlockingQueue.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XCache.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XCommandQueue.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XDateTuple.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XDomParser.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XDomParserNode.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XDuration.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XDynamicLibrary.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XException.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XFullVariant.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XGuard.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XHash.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XInternalList.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XJSON.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XListBox.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XLogger.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XMemory.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XMemoryMap.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XMonoClock.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XObjCount.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XObjectProxy.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XOption.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XPath.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XSocketAddress.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XSocket.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XSSLSocket.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XStackTrace.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XStopWatch.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XString.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XStringSlice.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XSymbol.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XSystemStats.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XTaskBase.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XTime.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XTimedCommandQueue.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XTimer.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XTimeZone.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XUDPReceiver.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XUDPSender.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XUuid.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XVariant.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XActor.cpp
      ${CMAKE_CURRENT_LIST_DIR}/source/XSHA256.cpp)


if(UNIX)
	list(APPEND XSDK_ALL_SOURCE
        ${CMAKE_CURRENT_LIST_DIR}/source/POSIX/Sprintf.cpp
        ${CMAKE_CURRENT_LIST_DIR}/source/POSIX/XCondition.cpp
        ${CMAKE_CURRENT_LIST_DIR}/source/POSIX/XMutex.cpp)
elseif(WIN32)
	list(APPEND XSDK_ALL_SOURCE
        ${CMAKE_CURRENT_LIST_DIR}/source/Win32/XCondition.cpp
        ${CMAKE_CURRENT_LIST_DIR}/source/Win32/XMutex.cpp)
endif()


target_include_directories(${PROJECT_NAME} PUBLIC ${XSDK_ALL_INCLUDE})

target_sources(${PROJECT_NAME} PRIVATE ${XSDK_ALL_SOURCE})